//
//  ShopDetailsHeaderView.m
//  大轮胎
//
//  Created by 朱永超 on 2017/3/30.
//  Copyright © 2017年 zyc. All rights reserved.
//

#import "ShopDetailsHeaderView.h"
#import <Masonry.h>
@implementation ShopDetailsHeaderView

-(instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        [self addSubview:self.headImageView];
        [self addSubview:self.titleLabel];
        
        [self.headImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self.mas_top).with.offset(10);
            make.left.mas_equalTo(self.mas_left).with.offset(10);
            make.height.mas_equalTo((self.frame.size.width-20)/3);
            make.width.mas_equalTo((self.frame.size.width-20)/3);
        }];
        [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self.mas_top).with.offset(10);
            make.left.mas_equalTo(self.headImageView.mas_right).with.offset(10);
            make.right.mas_equalTo(self.mas_right).with.offset(-10);
        }];
        
    }
    return self;
}

-(UIImageView *)headImageView
{
    if (!_headImageView) {
        _headImageView = [[UIImageView alloc] init];
    }
    return _headImageView;
}
-(UILabel *)titleLabel
{
    if (!_titleLabel) {
        _titleLabel = [[UILabel alloc] init];
        _titleLabel.font = [UIFont systemFontOfSize:18];
    }
    return _titleLabel;
}

@end
